package com.blb.ioc.demo1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class ComputerXmlTest {

    public static void main(String[] args) {
        // 创建IOC容器（暂）
        ApplicationContext context = new FileSystemXmlApplicationContext("G:\\JAVA_project\\ideaProjects_three\\java3\\day20231018SpringIOC\\src\\main\\resources\\spring.xml");
        // 从IOC容器获取对象 重载String 对象id,class 类型
//        Computer computer = (Computer) context.getBean("computer");
        Computer computer = context.getBean(Computer.class);
        computer.start();
    }
}
